#ifndef FLAGHANDLE_H
#define FLAGHANDLE_H
#include <stdint.h>
#include "./linkedList.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef enum {
  flagHandleStatus_ready = 0x50,
  flagHandleStatus_run,
  flagHandleStatus_finish,
  flagHandleStatus_stop,
  flagHandleStatus_error,
} FlagHandleStatusEnum;
typedef struct {
  uint16_t index;
  FlagHandleStatusEnum status;
  void* fun;
  void* args;
} FlagHandleStruct;  //监听器结构体

void flagHandle_init(void);
void flagHandle_addListener(uint16_t index, void* fun);
void flagHandle_delListener(uint16_t index);
void flagHandle_solve(void);
void flagHandle_setFlag(uint16_t index, void* args);
void flagHandle_resetFlag(uint16_t index);

#ifdef __cplusplus
}
#endif
#endif  // FLAGHANDLE_H
